package com.lleice.service.mapper.sys;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lleice.service.dto.DepartmentTreeDto;
import com.lleice.service.entity.sys.SysDepartment;

/**
 * <p>
 * 机构部门表 Mapper 接口
 * </p>
 *
 * @author lizihao
 * @since 2020-11-18
 */
@Mapper
public interface SysDepartmentMapper extends BaseMapper<SysDepartment> {
	/**
	 * 获取当前最大排序
	 * @param parentDepId 父部门id
	 * @return
	 */
	Integer getMaxOrderNum(@Param("parentDepId") Long parentDepId);
	
	/**
	 * 获取机构列表
	 * @return
	 */
	List<DepartmentTreeDto> getAllDepartment();
	
	/**
	 * 获取机构列表
	 * @param userId 用户id
	 * @return
	 */
	List<DepartmentTreeDto> getAllDepartmentWithUser(@Param("userId") Long userId);
}
